' Mission: Monotrooper
' written by the Math Wizard
' --------------------------
' Test program for maneuvering Monotrooper object
' 17 April 2009

#include "polygon2d.bas"

Type Monotrooper
    As Polygon Ptr  hull
    As Integer      angle
    As Integer      vel
    Declare Constructor( _
        ByRef   f       As String, _
        ByVal   a       As Integer, _
        ByVal   v       As Integer _
    )
End Type

Constructor Monotrooper( _
    ByRef   f   As String, _
    ByVal   a   As Integer, _
    ByVal   v   As Integer _
)
' Creates a new Monotrooper object by calling the
' Polygon constructor for the hull.

With This
    .hull = New Polygon(f)
    .angle = a
    .vel = v
End With

End Constructor

Dim As Monotrooper m = Monotrooper("monotrp.p2d", 0, 0)
Dim As Camera c = Camera(30, -30, -40, 40)
Dim As Integer i


' Set up the screen
ScreenRes 640, 480, 8
m.hull->Transform(MScale(1, 1))
m.hull->Project(c)
m.hull->Render

Sleep

For i = 0 To 359
    Cls
    m.hull->Transform(MRotate(i))
    m.hull->Project(c)
    m.hull->Render
    Sleep 20
Next i

Sleep
